//
//  BasicNavibarVC.swift
//  SwiftLearning
//
//  Created by 黄龙 on 2024/1/18.
//

import UIKit

class BasicNavibarVC: UIViewController {
    var workView = UIView()
    lazy var rightBar: UIBarButtonItem = {
        let bar = UIBarButtonItem(title: "测试", style:.done, target: self, action: #selector(clickRightbarItem))
        return bar
    }()
    
    deinit {
        if let title = self.title{
            print("~deinit: " + title)
        }else{
            print("~deinit: " + String(describing: self)) //eg:"<SwiftLearning.GradientLabelVC: 0x101d0b040>"
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor(red: 150.0/255.0, green: 216.0/255.0, blue: 115.0/255.0, alpha: 1.0)
        // Do any additional setup after loading the view.
        view.addSubview(workView)
        let space = UIDevice.ui_navigationFullHeight()//92
        workView.frame = CGRect(x: 0, y: space, width: screen_W, height: screen_H-space)
        workView.backgroundColor = .systemBackground
        
        if self.navigationController != nil{
            self.navigationItem.backButtonTitle = "返回" //修改push出来的下级页面，返回按钮的title由默认的back，改为"返回"
            self.navigationItem.setRightBarButton(rightBar, animated: true) //显示本页面标题栏左按钮
        }
        
        initView()
    }
    
    @objc func clickRightbarItem(){
        
    }
    
    func initView(){
        
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
